<?php
/**
 * @package pmapi
 * @copyright Copyright (c)2014 Enrico Fagnoni
 * @license GNU General Public License version 3, or later
 *
 * @since 1.0.0
 */
 
defined('_JEXEC') or die;

//initialize class autoloader for libraries and helpers
JLoader::register('SimpleTemplateEngine', JPATH_COMPONENT.DS.'libraries'.DS.'SimpleTemplateEngine.php');
JLoader::register('ApiHelper', JPATH_COMPONENT.DS.'helpers'.DS.'api.php');
JLoader::register('UriHelper', JPATH_COMPONENT.DS.'helpers'.DS.'uri.php');
JLoader::register('VmConfig', JPATH_ADMINISTRATOR.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');

// initialize virtuemart system
VmConfig::loadConfig();

// initialize name spaces for Platinum Mine Language see http://ontology.it/profiles/platinummine/v1
UriHelper::setLanguageProfile( array(
      'dcterms' => 'http://purl.org/dc/terms/',
      'ldp'     => 'http://www.w3.org/ns/ldp#',
      'ldpp'    => 'http://www.w3.org/ns/ldp-paging#',
      'foaf'    => 'http://xmlns.com/foaf/0.1/',
      'gr'      => 'http://purl.org/goodrelations/v1#',
      'org'     => 'http://www.w3.org/ns/org#',
      'owl'     => 'http://www.w3.org/2002/07/owl#',
      'pm'      => 'http://ontology.it/platinummine/v1#',
      'prov'    => 'http://www.w3.org/ns/prov#',
      'rdf'     => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
      'rdfa'    => 'http://www.w3.org/ns/rdfa#',
      'rdfs'    => 'http://www.w3.org/2000/01/rdf-schema#',
      'skos'    => 'http://www.w3.org/2004/02/skos/core#',
      'vcard'   => 'http://www.w3.org/2006/vcard/ns#',
      'void'    => 'http://rdfs.org/ns/void#',
      'xsd'     => 'http://www.w3.org/2001/XMLSchema#',
      'ebactor' => 'http://ontology.it/ebactor/v1#',
      'b2bo'    => 'http://purl.org/b2bo#',
      'o'       => UriHelper::mkNamespace('ontology'),
));  

// Include other Joomla dependencies
jimport('joomla.application.component.controller');

// Execute the task.
$controller	= JController::getInstance('Pmapi');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
